package org.assembly.huargo.model.samples;

import java.util.Date;

import org.apache.commons.lang.builder.EqualsBuilder;
import org.apache.commons.lang.builder.HashCodeBuilder;
import org.assembly.huargo.model.PersistentEntity;

/**
 * @author emanuel
 *
 */
public class Example extends PersistentEntity {

	private Long longExample;
	
	private String stringExample;

	private Date dateExample;
	
	public Example(Long longExample, String stringExample) {
		super();
		this.longExample = longExample;
		this.stringExample = stringExample;
	}

	public Long getLongExample() {
		return longExample;
	}

	public void setLongExample(Long longExample) {
		this.longExample = longExample;
	}

	public String getStringExample() {
		return stringExample;
	}

	public void setStringExample(String stringExample) {
		this.stringExample = stringExample;
	}

	public Date getDateExample() {
		return dateExample;
	}

	public void setDateExample(Date dateExample) {
		this.dateExample = dateExample;
	}


	/**
	 * @see org.assembly.huargo.model.Entity#bussinessEquals(java.lang.Object)
	 */
	@Override
	protected boolean bussinessEquals(Object obj) {
		Example otherExample = (Example) obj;
		return new EqualsBuilder().append(this.longExample, otherExample.longExample)
				.append(this.stringExample, otherExample.stringExample)
				.isEquals();
	}

	
	@Override
	public int hashCode() {
		return new HashCodeBuilder().append(this.longExample).append(this.stringExample).toHashCode();
	}
}
